<template>
    <div class="ma-content-block p-4">
        <!-- 搜索条件 -->
        <div class="flex">
            <a-tooltip content="请输入车号">
                <a-input v-model="form.car_no" placeholder="请输入车号如：川A6666" allow-clear style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px" />
            </a-tooltip>
            <a-tooltip content="请输入品名">
                <a-input v-model="form.goods_name" placeholder="请输入品名" allow-clear style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px" />
            </a-tooltip>
            <a-tooltip content="请输入箱号">
                <a-input v-model="form.box" placeholder="请输入箱号" allow-clear style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px" />
            </a-tooltip>
            <a-tooltip content="请输入箱型箱类">
                <a-input v-model="form.box_type" placeholder="请输入箱型箱类" allow-clear style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px" />
            </a-tooltip>
            <a-tooltip content="请输入发站">
                <a-input v-model="form.producer" placeholder="请输入发站" allow-clear style="width:calc((100% - 64px) / 5);margin-bottom:16px" />
            </a-tooltip>
        </div>
        <div class="flex">
            
            <a-tooltip content="请选择货主">
                <a-select style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px" v-model="form.dept_id" :options="dept_list" :field-names="fieldNamedept"  allow-clear allow-search
                        placeholder="请选择货主" />
            </a-tooltip>
            <a-tooltip content="请选择运输方式">
                <a-select style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px" v-model="form.transport_type" :options="transportList" :field-names="fieldNames" allow-clear allow-search
                        placeholder="请选择运输方式" />
            </a-tooltip>
            <a-tooltip content="请选择卸车时间">
                <a-range-picker
                    v-model="form.over_time"
                    @select="ddSelect"
                    @clear='overTimeClear'
                    :disabledDate="ddDisabledDate"
                    allow-clear
                    style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px"
                />
            </a-tooltip>
            <a-tooltip content="请选择入库时间">
                <a-range-picker
                    v-model="form.rk_time"
                    @select="rkSelect"
                    @clear='rkTimeClear'
                    :disabledDate="rkDisabledDate"
                    allow-clear
                    style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px"
                />
            </a-tooltip>
            <a-tooltip content="请选择到达时间">
                <a-range-picker
                    v-model="form.come_time"
                    @select="comeSelect"
                    @clear='comeCreatedAtClear'
                    :disabledDate="comeDisabledDate"
                    allow-clear
                    style="width:calc((100% - 64px) / 5);margin-bottom:16px"
                />
            </a-tooltip>
        </div>
        <div class="flex">
            <a-tooltip content="请选择创建时间">
                <a-range-picker
                    v-model="form.created_at"
                    @select="createdSelect"
                    @clear='createdCreatedAtClear'
                    :disabledDate="createdDisabledDate"
                    allow-clear
                    style="width:calc((100% - 64px) / 5);margin-right:16px;margin-bottom:16px"
                />
            </a-tooltip>
            <div class='flex'>
                <a-button type="primary"  @click="handleSearch" style="margin-right:16px">搜索</a-button>
                <a-button  @click="handleResetting" style="margin-right:16px">重置</a-button>
                <a-button type="primary"  @click="handleExport"> 导出Export</a-button>
            </div>
        </div>
        <div class="flex flex_wrap" style="margin-bottom:2%;background:rgba(246, 246, 246, 1);padding:16px;border-radius:6px">
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">预报总件数</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.number_yu}}</div>
                    <div class="font14 bule">件</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">计费总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.weight_yu}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            


            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">货重总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.hz_weight}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">标重总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.bz_weight}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">承运人总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.cyr_weight}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">剩余总件数</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.number}}</div>
                    <div class="font14 bule">件</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">剩余总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.weight}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">仓储总件数</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.cc_number}}</div>
                    <div class="font14 bule">件</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">仓储总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.cc_weight}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">提货总件数</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.th_pick_number}}</div>
                    <div class="font14 bule">件</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">提单总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.th_pick_weight}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">提单剩余总件数</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.th_pick_number_yu}}</div>
                    <div class="font14 bule">件</div>
                </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
                <div class="font14 heis">提单剩余总重量</div>
                <div class="flex align_end">
                    <div class="font20 bule bold" style="margin-right:2px">{{itemZong.th_pick_weight_yu}}</div>
                    <div class="font14 bule">吨</div>
                </div>
            </div>
        </div>
        <!-- 表格  :virtual-list-props="{threshold:14,height:600}"-->
        <a-table summary-text="合计" summary
            ref="exportTableRef" :pagination="{pageSize:100}" :columns="columns"
            :column-resizable="true" :data="tableData" :scroll="{x:2000, y:600 }"
            :table-layout-fixed="true" :bordered="{wrapper: true, cell: true}"
             >
            <template #transport_type = "{ record }">
                <div>{{ record.transport_type == 1?'集装箱':record.transport_type == 2?'整车':record.transport_type == 3?'零担':record.transport_type == 4?'批量零散':'' }}</div>
            </template>
            <template #serve_type = "{ record }">
                <div>{{ record.serve_type == 1?'托管':record.serve_type == 2?'配送':record.serve_type == 3?'自提':'' }}</div>
            </template>
            <template #th_buff_type = "{ record }">
                <div>{{ record.th_buff_type == 1?'对装':record.th_buff_type == 2?'非对装':record.th_buff_type == 0?'未知':'' }}</div>
            </template>
            <template #weight = "{ record }">
                <div>{{ (record.weight - 0).toFixed(3)}}</div>
            </template>
            <template #weight_yu = "{ record }">
                <div>{{ (record.weight_yu - 0).toFixed(3)}}</div>
            </template>
            <template #cc_weight = "{ record }">
                <div>{{ (record.cc_weight - 0).toFixed(3)}}</div>
            </template>
            <template #th_pick_weight = "{ record }">
                <div>{{ (record.th_pick_weight - 0).toFixed(3)}}</div>
            </template>
            <template #th_pick_weight_yu = "{ record }">
                <div>{{ (record.th_pick_weight_yu - 0).toFixed(3)}}</div>
            </template>
            <template #zc_weight_zong = "{ record }">
                <div>{{ (record.zc_weight_zong -0).toFixed(3)}}</div>
            </template>
            <template #zc_created_at = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_created_at" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.zc_created_at.length - 1)"></div>    
                    </div>
                </div>
            </template>
            <template #zc_deriver_car_no = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_deriver_car_no" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.zc_deriver_car_no.length - 1)"></div>    
                    </div>
                </div>
            </template>
            <template #zc_deriver_mobile = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_deriver_mobile" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.zc_deriver_mobile.length - 1)"></div>    
                    </div>
                </div>
            </template>
            
            <template #zc_deriver_number = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_deriver_number" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.zc_deriver_number.length - 1)"></div>    
                    </div>
                </div>
            </template>
            <template #zc_deriver_weight = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_deriver_weight" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.zc_deriver_weight.length - 1)"></div>    
                    </div>
                </div>
            </template>
            <template #zc_deriver_detail = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_deriver_detail" :key="indexse" style="">
                        <!-- <div>{{ item?'明细':'/' }}</div> -->
                        <a-popover title="费用明细" position="left">
                            <a-link >{{item?'明细':'/'}}</a-link>
                            <template #content>
                                <div style='min-width:300px'>
                                <a-table :columns="tablecolumnsts" :data="item" />
                                </div>
                            </template>
                        </a-popover>
                        <div class="line" v-if="indexse < (record.zc_deriver_weight.length - 1)"></div>    
                    </div>
                </div>
            </template>
            
            <template #zc_deriver_name = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.zc_deriver_name" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.zc_deriver_name.length - 1)"></div>    
                    </div>
                </div>
            </template>
            <template #th_order_no = "{ record }">
                <div class="zdy_Box">
                    <div class="min_box" v-for="(item,indexse) in record.th_order_no" :key="indexse" style="">
                        <div>{{ item || '/' }}</div>
                        <div class="line" v-if="indexse < (record.th_order_no.length - 1)"></div>
                    </div>
                </div>
            </template>
            <template #summary-cell="{ column, record }">
                {{
                    column.dataIndex == "car_no" ? "合计" :
                    column.dataIndex == "weight_yu"  ? (record[column.dataIndex] - 0).toFixed(3) + '吨' :
                    column.dataIndex == "number_yu"  ? record[column.dataIndex] + '件' :
                    column.dataIndex == "weight"  ? (record[column.dataIndex] - 0).toFixed(3) + '吨' :
                    column.dataIndex == "number"  ? record[column.dataIndex] + '件' :
                    column.dataIndex == "cc_weight"  ? (record[column.dataIndex] - 0).toFixed(3)  + '吨' :
                    column.dataIndex == "cc_number"  ? record[column.dataIndex]  + '件' :
                    column.dataIndex == "th_pick_weight"  ? (record[column.dataIndex] - 0).toFixed(3)  + '吨' :
                    column.dataIndex == "th_pick_number"  ? record[column.dataIndex]  + '件' :
                    column.dataIndex == "th_pick_weight_yu"  ? (record[column.dataIndex] - 0).toFixed(3) + '吨' :
                    column.dataIndex == "th_pick_number_yu"  ? record[column.dataIndex] + '件' :
                    column.dataIndex == "zc_weight_zong"  ? (record[column.dataIndex] - 0).toFixed(3) + '吨' :
                    column.dataIndex == "zc_number_zong"  ? record[column.dataIndex] + '件' :
                    ''
                }}
            </template>
        </a-table>
        
        <!-- 加载中... -->
        <div v-if="loading" style="position: fixed;width:100vw;height:100vh;background:rgba(0,0,0,.6);z-index:10;display:flex;top:0;left:0;justify-content: center;align-items: center;">
            <a-spin dot :size="10" />
        </div>
    </div>
  </template>
  <script setup>
  import { ref, reactive,onMounted } from 'vue'
  import { Message } from '@arco-design/web-vue'
  import { request } from "@/utils/request.js";
  import { pinyin } from "pinyin-pro"
  import tool from '@/utils/tool'
  import * as common from '@/utils/common'
  import * as XLSX from 'xlsx';
  const newDate = new Date();
  // 当天
  const newDay = newDate.getDate();  
  // 当年
  const newYear = newDate.getFullYear();
  // 当月
  const newMonth = (newDate.getMonth() + 1)>9?(newDate.getMonth() + 1):'0' + (newDate.getMonth() + 1);
  // 本月天数
  const newMaxDay = new Date(newYear, newMonth, 0).getDate();
  onMounted(()=>{
    handleDataList(form.value)
    handleDeptList()
  })
  const fieldNames = {value: 'key', label: 'value'}
  const fieldNamedept = {value: 'id', label: 'name'}
  const loading = ref(false)
  const transportList = ref([
    {key:1,value:'集装箱'},
    {key:2,value:'整车'},
    {key:3,value:'零担'},
    {key:4,value:'批量零散'},
  ])
  const serveList = ref([
    {key:1,value:'托管'},
    {key:2,value:'配送'},
    {key:3,value:'自提'},
  ])
  const buffList = ref([
    {key:1,value:'对装'},
    {key:2,value:'非对装'},
    {key:0,value:'未知'},
  ])
  const dept_list = ref([])
  const form = ref({
    car_no:'',   // 车号
    come_time:[],
    created_at:[],  // 创建时间
    over_time:[`${newYear}-${newMonth}-01`,`${newYear}-${newMonth}-${newMaxDay}`], // 卸车
    rk_time:[],  // 入库时间
    dept_id:'',   // 货主名称
    box:'',   // 集装箱
    box_type:'',   // 箱型箱类
    transport_type:'',   // 运输方式
    serve_type:'',   // 提货类型
    goods_name:'',   // 品名
    producer:'',   // 发站
    order_no:'',   // 提货订单号
    buff_type:'',   // 对装类型
    created_at:[],   // 提单时间
    zc_created_at:[],   // 装车时间
    deriver_car_no:'',   // 提货车号
    deriver_mobile:'',   // 司机电话
    deriver_name:'',   // 司机名称
  })
  const itemZong = ref({
    number_yu:0,
    weight_yu:0,
    number:0,
    weight:0,
    cc_number:0,
    cc_weight:0,
    th_pick_number:0,
    th_pick_weight:0,
    th_pick_number_yu:0,
    th_pick_weight_yu:0,
  })
  const filterOption = (v,option)=>{
    return option.keywords.some(keywords=>keywords.includes(v))
  }
  const handleDeptList = ()=>{
    request({
        url: 'system/dept/remote',
        method: 'post',
        data:{
          openPage:false,
          remoteOption:{
            filter:{
              type:['=',2],
              status: ['=',1]
            },
            select: ["id", "name"],
            sort: {id: "desc"}
          }
        }
      }).then(res=>{
        res.data.map((v,i)=>{
                v.keywords = [
                v.name,
                pinyin(v.name,{toneType:'none',pattern:'first'}).split(' ').join(''),
                pinyin(v.name,{toneType:'none',pattern:'first'}).split(' ').join('').toUpperCase()
                ]
        })
        dept_list.value = res.data
      })
  } 
  const tablecolumnsts = [
      {
        title: '收费项目',
        dataIndex: 'item_name',
        align:'center'
      },
      {
        title: '金额',
        dataIndex: 'pay_price',
        align:'center'
      },
];
  const exportTableRef = ref(null)
    //   预报时间
    const createdSelect = (valueString,value)=>{
        form.value.created_at = value;
    }
    // 清除预报时间
    const createdCreatedAtClear = (e)=>{
        form.value.created_at = []
    }
    //   到达时间
    const comeSelect = (valueString,value)=>{
        form.value.come_time = value;
    }
    // 清除到达时间
    const comeCreatedAtClear = (e)=>{
        form.value.come_time = []
    }
    //   装卸时间
    const ddSelect = (valueString,value)=>{
        form.value.over_time = value;
    }
    // 清除装卸时间
    const overTimeClear = (e)=>{
        form.value.over_time = []
    }
    const rkSelect = (valueString,value)=>{
        form.value.rk_time = value;
    }
    // 清除入库时间
    const rkTimeClear = (e)=>{
        form.value.rk_time = []
    }
    // const ddPopupVisibleChange = (visible)=>{
    //     console.log(visible)
    //     if (!visible) {
    //         form.value.update_at = []
    //     }
    // }
    const createdDisabledDate = (current)=>{
        const dates = form.value.created_at
        if (dates && dates.length) {
            const tooLate = dates[0] && Math.abs((new Date(current) - dates[0]) / (24 * 60 * 60 * 1000)) > 30;
            const tooEarly = dates[1] && Math.abs((new Date(current) - dates[1]) / (24 * 60 * 60 * 1000)) > 30;
            return tooEarly || tooLate;
        }
        return false;
    }
    const comeDisabledDate = (current)=>{
        const dates = form.value.come_time
        if (dates && dates.length) {
            const tooLate = dates[0] && Math.abs((new Date(current) - dates[0]) / (24 * 60 * 60 * 1000)) > 30;
            const tooEarly = dates[1] && Math.abs((new Date(current) - dates[1]) / (24 * 60 * 60 * 1000)) > 30;
            return tooEarly || tooLate;
        }
        return false;
    }
    const ddDisabledDate = (current)=>{
        const dates = form.value.over_time
        if (dates && dates.length) {
            const tooLate = dates[0] && Math.abs((new Date(current) - dates[0]) / (24 * 60 * 60 * 1000)) > 30;
            const tooEarly = dates[1] && Math.abs((new Date(current) - dates[1]) / (24 * 60 * 60 * 1000)) > 30;
            return tooEarly || tooLate;
        }
        return false;
    }
    const rkDisabledDate = (current)=>{
        const dates = form.value.rk_time
        if (dates && dates.length) {
            const tooLate = dates[0] && Math.abs((new Date(current) - dates[0]) / (24 * 60 * 60 * 1000)) > 30;
            const tooEarly = dates[1] && Math.abs((new Date(current) - dates[1]) / (24 * 60 * 60 * 1000)) > 30;
            return tooEarly || tooLate;
        }
        return false;
    }
    // 提单时间
    const tdSelect = (valueString,value)=>{
        form.value.created_at = value;
    }
    // const tdPopupVisibleChange = (visible)=>{
    //     if (!visible) {
    //         form.value.created_at = []
    //     }
    // }
    const tdDisabledDate = (current)=>{
        const dates = form.value.created_at
        if (dates && dates.length) {
            const tooLate = dates[0] && Math.abs((new Date(current) - dates[0]) / (24 * 60 * 60 * 1000)) > 30;
            const tooEarly = dates[1] && Math.abs((new Date(current) - dates[1]) / (24 * 60 * 60 * 1000)) > 30;
            return tooEarly || tooLate;
        }
        return false;
    }
    // 装车时间
    const zcSelect = (valueString,value)=>{
        
        form.value.zc_created_at = value;
    }
    // const zcPopupVisibleChange = (visible)=>{
    //     if (!visible) {
    //         form.value.zc_created_at = []
    //     }
    // }
    const zcDisabledDate = (current)=>{
        const dates = form.value.zc_created_at
        if (dates && dates.length) {
            const tooLate = dates[0] && Math.abs((new Date(current) - dates[0]) / (24 * 60 * 60 * 1000)) > 30;
            const tooEarly = dates[1] && Math.abs((new Date(current) - dates[1]) / (24 * 60 * 60 * 1000)) > 30;
            return tooEarly || tooLate;
        }
        return false;
    }
    // 清除装车时间
    const zcCreatedAtClear = (e)=>{
        form.value.zc_created_at = []
    }
    // 搜索
    const handleSearch = ()=>{
        let obj = JSON.parse(JSON.stringify(form.value))
        obj.car_no = obj.car_no.replace(/，/g, ',');
        
        
        handleDataList(obj)
    }
    // 重置
    const handleResetting = () =>{
        form.value = {
            car_no:'',   // 车号
            come_time:[], // 到达时间
            created_at:[],  // 创建时间
            over_time:[`${newYear}-${newMonth}-01`,`${newYear}-${newMonth}-${newMaxDay}`], // 卸车
            rk_time:[],
            dept_id:'',   // 货主名称
            box:'',   // 集装箱
            box_type:'',   // 箱型箱类
            transport_type:'',   // 运输方式
            serve_type:'',   // 提货类型
            goods_name:'',   // 品名
            producer:'',   // 发站
            order_no:'',   // 提货订单号
            buff_type:'',   // 对装类型
            created_at:[],   // 提单时间
            zc_created_at:[],   // 装车时间
            deriver_car_no:'',   // 提货车号
            deriver_mobile:'',   // 司机电话
            deriver_name:'',   // 司机名称
        }
        handleDataList(form.value)
    }
    // 导出
    const handleExport = ()=>{
      let data = [['序号','车号','到达时间','卸车时间','入库时间','货主名称','运输方式','提货类型','品名','集装箱','箱型箱类','箱属','发站','预报件数','预报重量','计费重量','剩余件数','剩余重量','暂存位置','仓储件数','仓储重量','仓储位置','提货订单号','对装类型','提单时间','提货总件数','提货总重量','剩余总件数','剩余总重量','提货单位','装车时间','提货车号','司机电话','司机名称','司机装车件数','司机装车重量','装车总件数','装车总重量','创建时间']]
      tableData.value.map((v,i)=>{
        let arr = [v.xuhao,v.car_no,v.come_time,v.over_time,v.rk_time,v.name,v.transport_type == 1?'集装箱':v.transport_type == 2?'整车':v.transport_type == 3?'零担':v.transport_type == 4?'批量零散':'',v.serve_type == 1?'托管':v.serve_type == 2?'配送':v.serve_type == 3?'自提':'',v.goods_name,v.box,v.box_type,v.box_belong,v.producer,v.number_yu,v.yb_number,v.weight_yu,v.number,v.weight,v.zc_weizhi,v.cc_number,v.cc_weight,v.cc_weizhi,v.th_order_no.join(','),v.th_buff_type == 1?'对装':v.th_buff_type == 2?'非对装':v.th_buff_type == 0?'未知':'',v.th_created_at,v.th_pick_number,v.th_pick_weight,v.th_pick_number_yu,v.th_pick_weight_yu,v.name,v.zc_created_at.join(','),v.zc_deriver_car_no.join(','),v.zc_deriver_mobile.join(','),v.zc_deriver_name.join(','),v.zc_deriver_number.join(','),v.zc_deriver_weight.join(','),v.zc_number_zong,v.zc_weight_zong,v.created_at]
        data.push(arr)
      })
      // 创建一个空的Workbook对象
      const wb = XLSX.utils.book_new();
 
      // 创建一个新的Worksheet
      const ws = XLSX.utils.aoa_to_sheet(data);
 
      // 将Worksheet添加到Workbook中
      XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
 
      // 生成Excel文件的Binary字符串
      const excelBinaryString = XLSX.write(wb, { type: 'binary' });
 
      // 将Binary字符串转换为Blob对象
      const blob = new Blob([s2ab(excelBinaryString)], { type: 'application/octet-stream' });
 
      // 导出Excel文件
      const fileName = '台账数据.xlsx';
      if (navigator.msSaveBlob) {
        // 兼容IE浏览器
        navigator.msSaveBlob(blob, fileName);
      } else {
        const link = document.createElement('a');
        link.href = URL.createObjectURL(blob);
        link.download = fileName;
        link.click();
        URL.revokeObjectURL(link.href);
      }
    

    }
    const s2ab = (s)=>{
        const buf = new ArrayBuffer(s.length);
        const view = new Uint8Array(buf);
        for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
        return buf;

    }
  const handleDataList = (obj)=>{   // 获取台账数据
        loading.value = true
        console.log('obj:',obj)
        let objs = JSON.parse(JSON.stringify(obj))
        if(objs.rk_time.length == 0 && objs.over_time.length == 0 && objs.come_time.length == 0 && objs.created_at.length == 0 && !objs.car_no && !objs.dept_id && !objs.transport_type && !objs.goods_name && !objs.box && !objs.box_type && !objs.producer && objs.zc_created_at.length == 0){
            Message.error('到达时间、装卸时间、入库时间、创建时间至少选择一种为查询条件')
            loading.value = false
            return 
        }
        if(objs.rk_time.length != 0){
            objs.rk_time = [objs.rk_time[0] + ' 00:00:00',objs.rk_time[1] + ' 23:59:59']
        }
        if(objs.over_time.length != 0){
            objs.over_time = [objs.over_time[0] + ' 00:00:00',objs.over_time[1] + ' 23:59:59']
        }
        if(objs.come_time.length != 0){
            objs.come_time = [objs.come_time[0] + ' 00:00:00',objs.come_time[1] + ' 23:59:59']
        }
        if(objs.created_at.length != 0){
            objs.created_at = [objs.created_at[0] + ' 00:00:00',objs.created_at[1] + ' 23:59:59']
        }

        let itemZongs = {
            number_yu:0,
            weight_yu:0,
            number:0,
            weight:0,
            cc_number:0,
            cc_weight:0,
            th_pick_number:0,
            th_pick_weight:0,
            th_pick_number_yu:0,
            th_pick_weight_yu:0,
            hz_weight:0,
            bz_weight:0,
            cyr_weight:0,
        }
        request({
            url:'/prediction/Tz/tzDetail',
            method: 'get',
            params:objs,
        }).then(res=>{
            
            let _data = res.data
            _data.map((v,i)=>{
                v.xuhao = i + 1
                v.name = v.dept.name
                v.weight_yu = (v.weight_yu - 0)
                v.weight = (v.weight - 0)
                v.zc_weizhi = ''    // 暂存位置
                v.cc_number = 0  // 仓储件数
                v.cc_weight = 0  // 仓储重量
                v.rk_time = ''
                v.cc_weizhi = ''  // 仓储位置
                v.th_order_no = ''  // 提货订单号
                v.th_buff_type = ''  // 对装类型
                v.th_created_at = ''  // 提单时间
                v.th_pick_number = 0  // 提货总件数
                v.th_pick_weight = 0  // 提货总重量
                v.th_pick_number_yu = 0 // 提货总剩余件数
                v.th_pick_weight_yu = 0  // 提货总剩余重量
                v.zc_created_at = []  // 装车时间
                v.zc_deriver_car_no = []  // 提货车号
                v.zc_deriver_mobile = []  // 司机电话
                v.zc_deriver_name = []  // 司机名称
                v.zc_deriver_number = [] // 司机装车数量
                v.zc_deriver_weight = [] // 司机装车重量
                v.zc_deriver_detail = [] // 司机收费明细
                v.zc_number_zong = 0  // 装车件数
                v.zc_weight_zong = 0  // 装车重量
                v.over_time = ''
                if(v.load_detail){
                    v.over_time = v.load_detail.over_time
                }
                // 处理暂存位置的逻辑  暂无
                // if(v.warehouse){
                //     v.zc_weizhi = v.warehouse.name + '横' + v.horizontal_position + '跨' + v.release_position + '层' + v.reaches_position
                // }
                //  装车数据
                let zc_number_zong = 0
                let zc_weight_zong = 0
                if(v.d_order_detail){
                    v.d_order_detail.map((vv,ii)=>{
                        v.zc_created_at.push(vv.created_at || '/')
                        v.zc_deriver_car_no.push(vv.d_order.deriver_car_no || '/')
                        v.zc_deriver_mobile.push(vv.d_order.deriver_mobile || '/')
                        v.zc_deriver_name.push(vv.d_order.deriver_name || '/')
                        
                        v.zc_deriver_number.push(vv.pick_number || '/')
                        // v.zc_deriver_detail.push(vv.)
                        v.zc_deriver_weight.push(vv.pick_weight || '/')
                        zc_number_zong += (vv.pick_number - 0)
                        zc_weight_zong += (vv.pick_weight - 0)
                        if(vv.d_order.financial){
                            let arr = []
                            let arrs = []
                            vv.d_order.financial.map((vvv,iii)=>{
                                console.log('收费明细：',vvv)
                                if(vvv.pay_items_json){
                                    vvv.pay_items_json.map((vvvv,iiii)=>{
                                        if(vvvv.pay_price != '0.00'){
                                            arr.push(vvvv)
                                        }
                                    })
                                    
                                }
                                
                            })
                            for(let i = 0;i<arr.length;i++){
                                let num = arrs.findIndex(item=>{
                                    return item.item_name == arr[i].item_name
                                })
                                if(num == -1){
                                    arrs.push(arr[i])
                                }else{
                                    arrs[num].pay_price = ((arr[i].pay_price - 0) + (arrs[num].pay_price - 0)).toFixed(2)
                                }
                            }
                            v.zc_deriver_detail.push(arrs)
                        }
                        
                    })
                }
                
                // 提货数据
                let th_pick_number = 0
                let th_pick_weight = 0
                let th_pick_number_yu = 0
                let th_pick_weight_yu = 0
                let th_order_no = []
                let th_buff_type = ''
                let th_created_at = ''
                if(v.order_detail.length != 0){
                    v.order_detail.map((vv,ii)=>{
                        th_pick_number += (vv.pick_number - 0)
                        th_pick_weight += (vv.pick_weight - 0)
                        th_pick_number_yu += (vv.pick_number_yu - 0)
                        th_pick_weight_yu += (vv.pick_weight_yu - 0)
                        if(vv.order){
                            th_order_no.push(vv.order.order_no || '/')
                            th_buff_type = vv.order.buff_type
                            th_created_at = vv.order.created_at
                        }
                    })
                }
               

                // 仓储提货
                let cc_number = 0
                let cc_weight = 0
                if(v.ware_user_detail.length != 0){
                    v.rk_time = v.ware_user_detail[0].created_at
                    v.ware_user_detail.map((vv,ii)=>{
                        cc_number += (vv.number - 0)
                        cc_weight += (vv.weight - 0)
                        if(vv.order_detail.length != 0){
                            vv.order_detail.map((vvv,iii)=>{
                                th_pick_number += (vvv.pick_number - 0)
                                th_pick_weight += (vvv.pick_weight - 0)
                                th_pick_number_yu += (vvv.pick_number_yu - 0)
                                th_pick_weight_yu += (vvv.pick_weight_yu - 0)
                                if(vvv.order){
                                    th_order_no.push(vvv.order.order_no || '/')
                                    th_buff_type = vvv.order.buff_type
                                    th_created_at = vvv.order.created_at
                                }
                            })
                            // th_pick_number = (vv.order_detail.pick_number - 0)
                            // th_pick_weight = (vv.order_detail.pick_weight - 0)
                            // th_pick_number_yu = (vv.order_detail.pick_number_yu - 0)
                            // th_pick_weight_yu = (vv.order_detail.pick_weight_yu - 0)
                            // console.log(i)
                            // th_order_no.push(vv.order_detail.order.order_no || '/')
                            // th_buff_type = vv.order_detail.order.buff_type
                            // th_created_at = vv.order_detail.order.created_at
                        }
                        if(vv.d_ware_user_detail.length != 0){
                            vv.d_ware_user_detail.map((vvv,iii)=>{
                                v.zc_created_at.push(vvv.created_at || '/')
                                if(vvv.d_order){
                                    v.zc_deriver_car_no.push(vvv.d_order.deriver_car_no || '/')
                                    v.zc_deriver_mobile.push(vvv.d_order.deriver_mobile || '/')
                                    v.zc_deriver_name.push(vvv.d_order.deriver_name || '/')
                                    v.zc_deriver_number.push(vvv.pick_number || '/')
                                    v.zc_deriver_weight.push(vvv.pick_weight || '/')
                                    zc_number_zong += (vvv.pick_number - 0)
                                    zc_weight_zong += (vvv.pick_weight - 0)
                                    if(vvv.d_order.financial){
                                        let arr = []
                                        let arrs = []
                                        vvv.d_order.financial.map((vvvv,iiii)=>{
                                            if(vvvv.pay_items_json){
                                                vvvv.pay_items_json.map((vvvvv,iiii)=>{
                                                    if(vvvvv.pay_price != '0.00'){
                                                        arr.push(vvvvv)
                                                    }
                                                })
                                                
                                            }
                                        })
                                        for(let i = 0;i<arr.length;i++){
                                            let num = arrs.findIndex(item=>{
                                                return item.item_name == arr[i].item_name
                                            })
                                            if(num == -1){
                                                arrs.push(arr[i])
                                            }else{
                                                arrs[num].pay_price = ((arr[i].pay_price - 0) + (arrs[num].pay_price - 0)).toFixed(2)
                                            }
                                        }
                                        v.zc_deriver_detail.push(arrs)
                                    }
                                    
                                }
                            })
                        }
                        // vv.order_detail.map((vvv,iii)=>{
                        //     th_pick_number += (vvv.pick_number - 0)
                        //     th_pick_weight += (vvv.pick_weight - 0)
                        //     th_pick_number_yu += (vvv.pick_number_yu - 0)
                        //     th_pick_weight_yu += (vvv.pick_weight_yu - 0)
                        // })
                    })
                }
                v.cc_number = cc_number
                v.cc_weight = cc_weight
                v.th_pick_number = th_pick_number
                v.th_pick_weight = th_pick_weight
                v.th_pick_number_yu = th_pick_number_yu
                v.th_pick_weight_yu = th_pick_weight_yu
                v.th_order_no = th_order_no
                v.th_buff_type = th_buff_type
                v.th_created_at = th_created_at
                v.zc_number_zong = zc_number_zong  // 装车件数
                v.zc_weight_zong = zc_weight_zong  // 装车重量
                // if(v.ware_user_detail){
                //     v.cc_number = v.ware_user_detail.number  // 仓储件数
                //     v.cc_weight = v.ware_user_detail.weight  // 仓储件数
                //     // v.cc_weizhi = v.ware_user_detail.warehouse.name + '横' + v.ware_user_detail.horizontal_position + '跨' + v.ware_user_detail.release_position + '层' + v.ware_user_detail.reaches_position
                //     if(v.ware_user_detail.order_detail){
                //         v.th_pick_number = v.ware_user_detail.order_detail.pick_number
                //         v.th_pick_weight = v.ware_user_detail.order_detail.pick_weight
                //         v.th_pick_number_yu = v.ware_user_detail.order_detail.pick_number_yu
                //         v.th_pick_weight_yu = v.ware_user_detail.order_detail.pick_weight_yu
                //         if(v.ware_user_detail.order_detail.order){
                //             v.th_order_no = v.ware_user_detail.order_detail.order.order_no
                //             v.th_buff_type = v.ware_user_detail.order_detail.order.buff_type
                //             v.th_created_at = v.ware_user_detail.order_detail.order.created_at
                //         }
                //     }
                    
                    
                // }
            })
            _data.map((v,i)=>{
                itemZongs.number_yu += (v.number_yu - 0)
                itemZongs.weight_yu += (v.weight_yu - 0)
                itemZongs.number += (v.number - 0)
                itemZongs.weight += (v.weight - 0)
                itemZongs.cc_number += (v.cc_number - 0)
                itemZongs.cc_weight += (v.cc_weight - 0)
                itemZongs.th_pick_number += (v.th_pick_number - 0)
                itemZongs.th_pick_weight += (v.th_pick_weight - 0)
                itemZongs.th_pick_number_yu += (v.th_pick_number_yu - 0)
                itemZongs.th_pick_weight_yu += (v.th_pick_weight_yu - 0)
                itemZongs.hz_weight += (v.hz_weight - 0)
                itemZongs.bz_weight += (v.bz_weight - 0)
                itemZongs.cyr_weight += (v.cyr_weight - 0)
            })
            itemZongs.weight_yu = (itemZongs.weight_yu - 0).toFixed(3)
            itemZongs.hz_weight = (itemZongs.hz_weight - 0).toFixed(3)
            itemZongs.bz_weight = (itemZongs.bz_weight - 0).toFixed(3)
            itemZongs.cyr_weight = (itemZongs.cyr_weight - 0).toFixed(3)
            itemZongs.weight = (itemZongs.weight - 0).toFixed(3)
            itemZongs.cc_weight = (itemZongs.cc_weight - 0).toFixed(3)
            itemZongs.th_pick_weight = (itemZongs.th_pick_weight - 0).toFixed(3)
            itemZongs.th_pick_weight_yu = (itemZongs.th_pick_weight_yu - 0).toFixed(3)
            itemZong.value = itemZongs
            tableData.value = _data
            setTimeout(() => {
                loading.value = false
            }, 1000)
            
        }).catch(rej=>{
            loading.value = false
        })
    }
  const tableData = ref([])
  const columns = reactive([
    {
        title: '序号',
        dataIndex: 'xuhao',
        width:70,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        fixed:'left'
    },
    {
        title: '车号',
        dataIndex: 'car_no',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        fixed:'left'
    },
    {
        title: '到达时间',
        dataIndex: 'come_time',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '卸车时间',
        dataIndex: 'over_time',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '入库时间',
        dataIndex: 'rk_time',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '货主名称',
        dataIndex: 'name',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '运输方式',
        dataIndex: 'transport_type',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'transport_type',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提货类型',
        dataIndex: 'serve_type',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'serve_type',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '品名',
        dataIndex: 'goods_name',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '集装箱',
        dataIndex: 'box',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '箱型箱类',
        dataIndex: 'box_type',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '箱属',
        dataIndex: 'box_belong',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '发站',
        dataIndex: 'producer',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '预报件数',
        dataIndex: 'number_yu',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
    },
    {
        title: '预报重量',
        dataIndex: 'yb_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '货重',
        dataIndex: 'hz_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'hz_weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '标重',
        dataIndex: 'bz_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'bz_weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '计费重量',
        dataIndex: 'jf_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'jf_weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '承运人重量',
        dataIndex: 'cyr_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'cyr_weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '剩余件数',
        dataIndex: 'number',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '剩余重量',
        dataIndex: 'weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '暂存位置',
        dataIndex: 'zc_weizhi',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '仓储件数',
        dataIndex: 'cc_number',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '仓储重量',
        dataIndex: 'cc_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'cc_weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '仓储位置',
        dataIndex: 'cc_weizhi',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提货订单号',
        dataIndex: 'th_order_no',
        width:160,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'th_order_no',
    },
    
    {
        title: '对装类型',
        dataIndex: 'th_buff_type',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'th_buff_type',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提单时间',
        dataIndex: 'th_created_at',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提货总件数',
        dataIndex: 'th_pick_number',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提单总重量',
        dataIndex: 'th_pick_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'th_pick_weight',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '提单剩余总件数',
        dataIndex: 'th_pick_number_yu',
        width:160,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提单剩余总重量',
        dataIndex: 'th_pick_weight_yu',
        width:160,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'th_pick_weight_yu',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    {
        title: '提货单位',
        dataIndex: 'name',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        }
    },
    
    {
        title: '装车时间',
        dataIndex: 'zc_created_at',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_created_at',
    },
    {
        title: '提货车号',
        dataIndex: 'zc_deriver_car_no',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_deriver_car_no',
    },
    {
        title: '司机电话',
        dataIndex: 'zc_deriver_mobile',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_deriver_mobile',
    },
    {
        title: '司机名称',
        dataIndex: 'zc_deriver_name',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_deriver_name',
    },
    {
        title: '司机装车件数',
        dataIndex: 'zc_deriver_number',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_deriver_number',
    },
    {
        title: '司机装车重量',
        dataIndex: 'zc_deriver_weight',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_deriver_weight',
    },
    {
        title: '司机装车明细',
        dataIndex: 'zc_deriver_detail',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'zc_deriver_detail',
    },
    
    {
        title: '装车件数',
        dataIndex: 'zc_number_zong',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
    },
    {
        title: '装车重量',
        dataIndex: 'zc_weight_zong',
        width:120,
        align:'center',
        ellipsis:true,
        tooltip:true,
        slotName:'zc_weight_zong',
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
    },
    {
        title: '创建时间',
        dataIndex: 'created_at',
        width:200,
        align:'center',
        ellipsis:true,
        tooltip:true,
        headerCellStyle:{
            background:'rgba(46,87,170,1)',
            color:'#fff'
        },
        slotName:'created_at',
    },
  ])
  
  </script>
  <style>
  .arco-scrollbar-thumb-direction-vertical .arco-scrollbar-thumb-bar{
    width: 15px;
    margin:0 3px
  }
  .arco-scrollbar-thumb-direction-horizontal .arco-scrollbar-thumb-bar{
    height: 15px;
    margin:3px 0;
  }
  .arco-table .arco-table-cell{
    padding: 9px 0;
  }
  .zdy_Box{

  }
  .zdy_Box .min_box{
        
  }
  .zdy_Box .min_box:last-child{
    border-bottom:none
  }
  .zdy_Box .min_box .line{
    width:100%;
    height:1px;
    background:rgb(229,230,235);
    margin: 9px 0;
  }
  
  </style>
  <script> 
    export default { name: 'ledger:ledgerDetail' } 
  </script>
  